<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
	<!-- Safari为meta标签新增minimal-ui属性，在网页加载时隐藏地址栏与导航栏 -->
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minxmum-scale=1.0, user-scalable=no, minimal-ui">
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta name="format-detection" content="telephone=no">
	<meta name="full-screen" content="yes">
	<meta name="x5-fullscreen" content="true">
	<meta http-equiv="Pragma" content="no-cache">
	<meta http-equiv="Cache-control" content="no-cache">
	<meta http-equiv="Cache" content="no-cache">
	<title>东湖绿道</title>
	<link rel="stylesheet" href="<?=HW_STA?>weixin/css/weuix.min.css"/>
	<link rel="stylesheet" type="text/css" href="<?=HW_STA?>weixin/css/style.css">
	<link rel="stylesheet" href="<?=HW_CSS?>AppFont/iconfont.css">
	<!-- <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/0.4.0/weui.min.css"> -->
	<style>
	.rank_logo{
		color: #fff;
		position: absolute;
		right: .64rem;
		top: 0.64rem;
		font-size: 1rem;
	}
	.rank_logo img{
		height: 1.44rem;
	}
</style>
</head>
<body style="display: none;">
	<a class="rank-back">
		<img src="<?=HW_IMG?>back_g.png" alt="">
	</a>
	<div class="rank_logo">
		<img src="<?=HW_IMG?>logo_green.png" alt="">
	</div>
	<div class="androidInformation">
		<div class="androidInformation-panel">
			<div class="androidInformation-panel__header">
				<?=$info['theme']?>
			</div>
			<small class="androidInformation-panel__time">
				<?=date('Y-m-d',strtotime($info['create_time']))?>
			</small>
			<div class="androidInformation-panel__info" id='info'>
				<?=$info['content']?>
			</div>
			<div class="androidInformation-panel__page">
				<div class="androidInformation-panel__page-left" id='prev'>上一页</div>
				<div class="androidInformation-panel__page-right" id='next'>下一页</div>
			</div>
		</div>
		<?php if(isset($relation) && !empty($relation)){?>
			<div class="androidInformation-more">
				<div class="androidInformation-more__header">更多资讯</div>
				<div class="androidInformation-more__box">
					<?php foreach ($relation as $key => $v) { ?>
						<div class="androidInformation-more__item">
							<a href="<?=$v['url']?>">
								<img src="<?=$v['default_img']?>" alt="">
								<div class="androidInformation-more__item-intro">
									<a href="##"><?=$v['theme']?></a>
								</div>
							</a>
						</div>
						<?php }?>
					</div>
				</div>
				<?php }?>
			</div>
		</body>
		<script type="text/javascript" src="<?=HW_JS?>jquery-2.0.2.min.js"></script>
		<script type="text/javascript" src="<?=HW_STA?>weui/weui.min.js"></script>
		<!-- <script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> -->
		<script src="<?=HW_JS?>rem.js"></script>
		<script>
			var type = "<?=$type?>";
			$(".rank-back").on('click',function(){
				if (type<2) {
					WebViewJavascriptBridge.callHandler(
						'route', {'finish': true}, function(responseData) {
						});
				} else {
					window.history.go(-1);
				}
			})
			window.onload = function(){
				var a = document.documentElement,
				b = a.clientWidth > 750 ? 750 : a.clientWidth;
				a.style.fontSize = b / 15 + 'px';
				document.body.style.display = 'block';
				var obj = document.getElementById("info"); 
				var pgindex = 1;
				var allpage = Math.ceil(parseInt(obj.scrollHeight)/parseInt(obj.offsetHeight)) + 1;
				console.log('allpage',allpage)
				function showPage(pgIndex){
					obj.scrollTop = (pgIndex - 1) * parseInt(obj.offsetHeight);
					pgindex = pgIndex
				}
				$("#next").click(function(){
					console.log('+', pgindex)
					$("#prev").removeClass("dis");
					if(pgindex + 1 <allpage){
						showPage(pgindex + 1)	
					}
					if(pgindex + 1 == allpage || pgindex == allpage){
						$("#next").addClass("dis");
					}
				})
				$("#prev").click(function(){
					$("#next").removeClass("dis");
					console.log(pgindex - 1)
					if(pgindex - 1 > 0){
						showPage(pgindex - 1)
					}
					if(pgindex - 1 == 0){
						$("#prev").addClass("dis");
					}
				})
			}

		</script>
		</html>
